/* Filename: star.c
 * Description:
 * Last modified: humble 20200327 15:06
 */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>

static void usage(void);

void int_handler(int i)
{
    write(1, "!", 1);
}

int main(int argc, char **argv)
{
    int i;

    if(argc != 1){
        fprintf(stderr, "argc !=1");
        usage();
        exit(1);
    }

    //signal(SIGINT, SIG_IGN);
    signal(SIGINT, int_handler);

    for(i = 0; i < 10; i++)
    {
        write(1, "*", 1);
        sleep(1);
    }
    return 0;
}

static void usage(void)
{
#define USAGE "Usage:\n\
  Helloworld\n"
    printf(USAGE);
}
